package com.heima.article.feign;

import com.heima.apis.article.IArticleClient;
import com.heima.article.service.ArticleService;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.article.dtos.ArticleCollectionDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ybw
 * @version 1.0
 * @date 2021/12/14 16:15
 */
@RestController
@RequestMapping("/api/v1/article")
public class ArticleClient implements IArticleClient {
  @Autowired private ArticleService articleService;

  /**
   * 保存文章
   *
   * @param articleDto
   * @return
   */
  @Override
  @PostMapping("/save")
  public ResponseResult saveArticle(ArticleDto articleDto) {
    ResponseResult result = articleService.saveArticle(articleDto);
    return result;
  }
}
